import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../../common/style/bny_color.dart';

class LoginUtils {
  static Widget loginBgView({required Widget child,String picName=''}) {
    return Container(
      decoration:  BoxDecoration(
        image: DecorationImage(
            image: AssetImage(picName==''?'assets/images/eh_login_bg.png':picName),
            fit: BoxFit.fill),
      ),
      child: child,
    );
  }

  static Widget cornerTextView(String name, Function onTapBack) {
    return TextButton(
        onPressed: () {
          onTapBack();
        },
        child: Container(
          padding: EdgeInsets.symmetric(horizontal: 96.w, vertical: 15.h),
          decoration: BoxDecoration(
              gradient: LinearGradient(colors: <Color>[
                HexColor('0096D0'),
                HexColor('0076A9'),
              ], begin: const Alignment(-1, 0), end: const Alignment(1.0, 0)),
              borderRadius: BorderRadius.circular(15.r)),
          child: Text(
            name,
            style: const TextStyle(
                fontSize: 22, fontWeight: FontWeight.w600, color: Colors.white),
          ),
        ));
  }
}
